from utils.abstract_repository import AbstractRepository
from utils.models.region import Region


class RegionRepository(AbstractRepository[Region]):
    model = Region

    async def remove_one_gold(self, region_id: int) -> None:
        await self.edit_by_id(region_id, gold=self.model.gold-1)
        return

    async def reset_gold(self) -> None:
        await self.edit_all(gold=self.model.max_gold)
        return
